/*******************************************************************************
 * Copyright 2014 United States Government as represented by the
 * Administrator of the National Aeronautics and Space Administration.
 * All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
/*
 * Created on Apr 6, 2005
 *
 */
package gov.nasa.arc.spife.tests.europa;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import gov.nasa.arc.spife.europa.EuropaPlugin;
import gov.nasa.arc.spife.europa.EuropaSessionClient;
import gov.nasa.arc.spife.europa.FlightRuleViolation;
import gov.nasa.arc.spife.europa.IFlightRuleViolation;
import gov.nasa.arc.spife.europa.clientside.EuropaCommand;
import gov.nasa.arc.spife.europa.clientside.EuropaServerManager;
import gov.nasa.arc.spife.europa.preferences.EuropaPreferences;

import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Vector;

import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.osgi.framework.Bundle;

/**
 * @author Dennis Michael Heher
 *
 */
//public class TestEuropaSessionClient extends TestCase {
public class TestEuropaSessionClient {

	private final Logger trace = Logger.getLogger(TestEuropaSessionClient.class);
	private String host; 
	private int port;
	
	private Map<String,String> temporalBoundConstraints;
	private Map<String,String> temporalRelationConstraints;

	private static class TestScenario {
		public static String[] registerInfo = {
					"[A85929, 130810036, 490, CPU_ON, CPU]",
					"[A17110, 130813106, 828, CPU_ON, CPU]",
					"[A27244, 130802463, 1, CPU_ON, CPU]",
					"[A19597, 130799713, 1676, CPU_ON, CPU]",
					"[A30120, 130810980, 154, CPU_ON, CPU]",
					"[A25664, 130799278, 434, CPU_ON, CPU]",
					"[A27863, 130813036, 71, CPU_ON, CPU]",
					"[A19220, 130802149, 129, CPU_ON, CPU]",
					"[A32948, 130803362, 3001, CPU_ON, CPU]",
					"[A10860, 130811300, 699, CPU_ON, CPU]",
					"[A24171, 130798303, 434, CPU_ON, CPU]",
					"[A24434, 130802280, 184, CPU_ON, CPU]",
					"[A10233, 130797571, 300, CPU_ON, CPU]",
					"[A31177, 130801534, 434, CPU_ON, CPU]",
					"[A58474, 130880782, 168, CPU_ON, CPU]",
					"[A15669, 130797870, 434, CPU_ON, CPU]",
					"[A26795, 130803261, 99, CPU_ON, CPU]",
					"[A18616, 130812267, 185, CPU_ON, CPU]",
					"[A25839, 130798845, 434, CPU_ON, CPU]",
					"[A16040, 130809538, 250, CPU_ON, CPU]",
					"[A11293, 130812111, 156, CPU_ON, CPU]",
					"[A42428, 130810980, 1, CPU_ON, CPU]",
					"[A18169, 130809522, 99, CPU_ON, CPU]",
					"[A31854, 130797520, 49, CPU_ON, CPU]",
					"[ROVER_, 130801969, 180, CPU_ON, CPU]",
					"[A30321, 130809424, 71, CPU_ON, CPU]",
					"[A23587, 130796588, 49, CPU_ON, CPU]",
					"[A93062, 130881105, 1870, CPU_ON, CPU]",
					"[A20797, 130795707, 365, CPU_ON, CPU]",
					"[A26661, 130802463, 800, CPU_ON, CPU]",
					"[A26054, 130809423, 99, CPU_ON, CPU]",
					"[A10821, 130814489, 250, CPU_ON, CPU]",
					"[A23065, 130796639, 365, CPU_ON, CPU]",
					"[A18595, 130809788, 250, CPU_ON, CPU]",
					"[A22935, 130811134, 168, CPU_ON, CPU]",
					"[A18735, 130880951, 154, CPU_ON, CPU]",
					"[A23836, 130802280, 1, CPU_ON, CPU]",
					"[A25886, 130880951, 1, CPU_ON, CPU]",
					"[A28888, 130812453, 362, CPU_ON, CPU]"
					};		 
			
	    public static String[] temporalBoundInfo = {
				    "[A19597, start, 130799715, 268435456]",
					"[A16040, end, 126409039, 130816360]",
					"[A16040, start, 130807113, 268435456]",
					"[A10821, end, 126409039, 130816360]",
					"[A10821, start, 130807113, 268435456]",
					"[A18595, start, 130807113, 268435456]",
					"[A18595, end, 126409039, 130816360]"
			        };
			
	    public static String[] temporalRelationInfo = {
				    "[A11293, end, A85929, start, -268435456, 1500]",
					"[A23587, end, A85929, start, 0, 268435456]",
					"[A27244, end, A85929, start, 0, 268435456]",
					"[A31177, end, A85929, start, 0, 268435456]",
					"[A25664, end, A85929, start, 0, 268435456]",
					"[A32948, end, A85929, start, 0, 268435456]",
					"[A24434, end, A85929, start, 0, 268435456]",
					"[A10233, end, A85929, start, 0, 268435456]",
					"[A25839, end, A85929, start, 0, 268435456]",
					"[A19597, end, A85929, start, 0, 268435456]",
					"[A31854, end, A85929, start, 0, 268435456]",
					"[A23836, end, A85929, start, 0, 268435456]",
					"[A15669, end, A85929, start, 0, 268435456]",
					"[A85929, end, A11293, start, -268435456, 1500]",
					"[A20797, end, A85929, start, 0, 268435456]",
					"[A24171, end, A85929, start, 0, 268435456]",
					"[A26661, end, A85929, start, 0, 268435456]",
					"[A19220, end, A85929, start, 0, 268435456]",
					"[A26795, end, A85929, start, 0, 268435456]",
					"[A23065, end, A85929, start, 0, 268435456]",
					"[A32948, end, A17110, start, 0, 268435456]",
					"[A20797, end, A17110, start, 0, 268435456]",
					"[A25664, end, A17110, start, 0, 268435456]",
					"[A24434, end, A17110, start, 0, 268435456]",
					"[A23065, end, A17110, start, 0, 268435456]",
					"[A19220, end, A17110, start, 0, 268435456]",
					"[A15669, end, A17110, start, 0, 268435456]",
					"[A23836, end, A17110, start, 0, 268435456]",
					"[A19597, end, A17110, start, 0, 268435456]",
					"[A31854, end, A17110, start, 0, 268435456]",
					"[A26661, end, A17110, start, 0, 268435456]",
					"[A23587, end, A17110, start, 0, 268435456]",
					"[A26795, end, A17110, start, 0, 268435456]",
					"[A24171, end, A17110, start, 0, 268435456]",
					"[A31177, end, A17110, start, 0, 268435456]",
					"[A10233, end, A17110, start, 0, 268435456]",
					"[A25839, end, A17110, start, 0, 268435456]",
					"[A27244, end, A17110, start, 0, 268435456]",
					"[A27244, end, A27863, start, 0, 268435456]",
					"[A27244, end, A26054, start, 0, 268435456]",
					"[A27244, end, A11293, start, 0, 268435456]",
					"[A27244, end, A28888, start, 0, 268435456]",
					"[A27244, end, A85929, start, 0, 268435456]",
					"[A27244, end, A10821, start, 0, 268435456]",
					"[A27244, end, A10860, start, 0, 268435456]",
					"[A27244, end, A16040, start, 0, 268435456]",
					"[A27244, end, A32948, start, 0, 268435456]",
					"[A27244, end, A18595, start, 0, 268435456]",
					"[A27244, end, A26795, start, 0, 268435456]",
					"[A27244, end, A18616, start, 0, 268435456]",
					"[A27244, end, A18169, start, 0, 268435456]",
					"[A27244, end, A30321, start, 0, 268435456]",
					"[A27244, end, A17110, start, 0, 268435456]",
					"[A31177, end, A27244, start, 0, 268435456]",
					"[A15669, end, A27244, start, 0, 268435456]",
					"[A20797, end, A27244, start, 0, 268435456]",
					"[A27244, start, A26661, start, 0, 0]",
					"[A25839, end, A27244, start, 0, 268435456]",
					"[A23065, end, A27244, start, 0, 268435456]",
					"[A10233, end, A27244, start, 0, 268435456]",
					"[A25664, end, A27244, start, 0, 268435456]",
					"[A24171, end, A27244, start, 0, 268435456]",
					"[A31854, end, A27244, start, 0, 268435456]",
					"[A23587, end, A27244, start, 0, 268435456]",
					"[A19597, end, A27244, start, 0, 268435456]",
					"[A19597, end, A10860, start, 0, 268435456]",
					"[A19597, end, A18595, start, 0, 268435456]",
					"[A19597, end, A32948, start, 0, 268435456]",
					"[A19597, end, A26795, start, 0, 268435456]",
					"[A31177, end, A19597, start, -268435456, 1500]",
					"[A19597, end, A30321, start, 0, 268435456]",
					"[A19597, end, A19220, start, 0, 268435456]",
					"[A19597, end, A28888, start, 0, 268435456]",
					"[A19597, end, A18169, start, 0, 268435456]",
					"[A19597, end, A17110, start, 0, 268435456]",
					"[A19597, end, A85929, start, 0, 268435456]",
					"[A19597, end, A27863, start, 0, 268435456]",
					"[A19597, end, A11293, start, 0, 268435456]",
					"[A19597, end, A24434, start, 0, 268435456]",
					"[A19597, end, A10821, start, 0, 268435456]",
					"[A19597, end, A26054, start, 0, 268435456]",
					"[A19597, end, A23836, start, 0, 268435456]",
					"[A19597, end, A26661, start, 0, 268435456]",
					"[A19597, end, A18616, start, 0, 268435456]",
					"[A19597, end, A16040, start, 0, 268435456]",
					"[A19597, end, A27244, start, 0, 268435456]",
					"[A19597, end, A31177, start, -268435456, 1500]",
					"[A30120, end, A22935, start, 0, 0]",
					"[A30120, start, A42428, start, 0, 0]",
					"[A25839, end, A25664, start, -268435456, 1500]",
					"[A25664, end, A18169, start, 0, 268435456]",
					"[A25664, end, A30321, start, 0, 268435456]",
					"[A25664, end, A18616, start, 0, 268435456]",
					"[A25664, end, A17110, start, 0, 268435456]",
					"[A25664, end, A28888, start, 0, 268435456]",
					"[A25664, end, A85929, start, 0, 268435456]",
					"[A25664, end, A18595, start, 0, 268435456]",
					"[A25664, end, A32948, start, 0, 268435456]",
					"[A25664, end, A10821, start, 0, 268435456]",
					"[A25664, end, A16040, start, 0, 268435456]",
					"[A25664, end, A26795, start, 0, 268435456]",
					"[A25664, end, A19220, start, 0, 268435456]",
					"[A25664, end, A23836, start, 0, 268435456]",
					"[A25664, end, A27244, start, 0, 268435456]",
					"[A25664, end, A26661, start, 0, 268435456]",
					"[A25664, end, A26054, start, 0, 268435456]",
					"[A25664, end, A27863, start, 0, 268435456]",
					"[A25664, end, A10860, start, 0, 268435456]",
					"[A25664, end, A11293, start, 0, 268435456]",
					"[A25664, end, A24434, start, 0, 268435456]",
					"[A25664, end, A25839, start, -268435456, 1500]",
					"[A23587, end, A27863, start, 0, 268435456]",
					"[A27244, end, A27863, start, 0, 268435456]",
					"[A25839, end, A27863, start, 0, 268435456]",
					"[A24434, end, A27863, start, 0, 268435456]",
					"[A23065, end, A27863, start, 0, 268435456]",
					"[A19220, end, A27863, start, 0, 268435456]",
					"[A31177, end, A27863, start, 0, 268435456]",
					"[A31854, end, A27863, start, 0, 268435456]",
					"[A19597, end, A27863, start, 0, 268435456]",
					"[A15669, end, A27863, start, 0, 268435456]",
					"[A26661, end, A27863, start, 0, 268435456]",
					"[A26795, end, A27863, start, 0, 268435456]",
					"[A32948, end, A27863, start, 0, 268435456]",
					"[A24171, end, A27863, start, 0, 268435456]",
					"[A25664, end, A27863, start, 0, 268435456]",
					"[A23836, end, A27863, start, 0, 268435456]",
					"[A10233, end, A27863, start, 0, 268435456]",
					"[A20797, end, A27863, start, 0, 268435456]",
					"[A19220, end, A18169, start, 0, 268435456]",
					"[A19220, end, A11293, start, 0, 268435456]",
					"[A19220, end, A10821, start, 0, 268435456]",
					"[A19220, end, A32948, start, 0, 268435456]",
					"[A19220, end, A17110, start, 0, 268435456]",
					"[A19220, end, A27863, start, 0, 268435456]",
					"[A19220, end, A30321, start, 0, 268435456]",
					"[A19220, end, A18616, start, 0, 268435456]",
					"[A19220, end, A18595, start, 0, 268435456]",
					"[A19220, end, A16040, start, 0, 268435456]",
					"[A19220, end, A10860, start, 0, 268435456]",
					"[A19220, end, A26054, start, 0, 268435456]",
					"[A19220, end, A28888, start, 0, 268435456]",
					"[A19220, end, A85929, start, 0, 268435456]",
					"[A19220, end, A26795, start, 0, 268435456]",
					"[A20797, end, A19220, start, 0, 268435456]",
					"[A15669, end, A19220, start, 0, 268435456]",
					"[A24171, end, A19220, start, 0, 268435456]",
					"[A31177, end, A19220, start, 0, 268435456]",
					"[A31854, end, A19220, start, 0, 268435456]",
					"[A25664, end, A19220, start, 0, 268435456]",
					"[A23587, end, A19220, start, 0, 268435456]",
					"[A10233, end, A19220, start, 0, 268435456]",
					"[A19597, end, A19220, start, 0, 268435456]",
					"[A25839, end, A19220, start, 0, 268435456]",
					"[A23065, end, A19220, start, 0, 268435456]",
					"[A32948, end, A17110, start, 0, 268435456]",
					"[A32948, end, A11293, start, 0, 268435456]",
					"[A32948, end, A10860, start, 0, 268435456]",
					"[A32948, end, A18595, start, 0, 268435456]",
					"[A32948, end, A85929, start, 0, 268435456]",
					"[A32948, end, A10821, start, 0, 268435456]",
					"[A32948, end, A18169, start, 0, 268435456]",
					"[A32948, end, A30321, start, 0, 268435456]",
					"[A32948, end, A26054, start, 0, 268435456]",
					"[A32948, end, A27863, start, 0, 268435456]",
					"[A32948, end, A28888, start, 0, 268435456]",
					"[A32948, end, A18616, start, 0, 268435456]",
					"[A32948, end, A16040, start, 0, 268435456]",
					"[A15669, end, A32948, start, 0, 268435456]",
					"[A23065, end, A32948, start, 0, 268435456]",
					"[A24434, end, A32948, start, 0, 268435456]",
					"[A19220, end, A32948, start, 0, 268435456]",
					"[A24171, end, A32948, start, 0, 268435456]",
					"[A19597, end, A32948, start, 0, 268435456]",
					"[A25664, end, A32948, start, 0, 268435456]",
					"[A31177, end, A32948, start, 0, 268435456]",
					"[A23587, end, A32948, start, 0, 268435456]",
					"[A10233, end, A32948, start, 0, 268435456]",
					"[A26661, end, A32948, start, 0, 268435456]",
					"[A27244, end, A32948, start, 0, 268435456]",
					"[A25839, end, A32948, start, 0, 268435456]",
					"[A20797, end, A32948, start, 0, 268435456]",
					"[A23836, end, A32948, start, 0, 268435456]",
					"[A31854, end, A32948, start, 0, 268435456]",
					"[A26795, end, A32948, start, 0, 268435456]",
					"[A18616, end, A10860, start, -268435456, 1500]",
					"[A31854, end, A10860, start, 0, 268435456]",
					"[A19597, end, A10860, start, 0, 268435456]",
					"[A24171, end, A10860, start, 0, 268435456]",
					"[A10860, end, A18616, start, -268435456, 1500]",
					"[A32948, end, A10860, start, 0, 268435456]",
					"[A26661, end, A10860, start, 0, 268435456]",
					"[A23065, end, A10860, start, 0, 268435456]",
					"[A27244, end, A10860, start, 0, 268435456]",
					"[A20797, end, A10860, start, 0, 268435456]",
					"[A24434, end, A10860, start, 0, 268435456]",
					"[A23836, end, A10860, start, 0, 268435456]",
					"[A25839, end, A10860, start, 0, 268435456]",
					"[A23587, end, A10860, start, 0, 268435456]",
					"[A31177, end, A10860, start, 0, 268435456]",
					"[A19220, end, A10860, start, 0, 268435456]",
					"[A10233, end, A10860, start, 0, 268435456]",
					"[A26795, end, A10860, start, 0, 268435456]",
					"[A25664, end, A10860, start, 0, 268435456]",
					"[A15669, end, A10860, start, 0, 268435456]",
					"[A24171, end, A11293, start, 0, 268435456]",
					"[A24171, end, A10860, start, 0, 268435456]",
					"[A24171, end, A32948, start, 0, 268435456]",
					"[A24171, end, A10821, start, 0, 268435456]",
					"[A15669, end, A24171, start, -268435456, 1500]",
					"[A24171, end, A18616, start, 0, 268435456]",
					"[A24171, end, A16040, start, 0, 268435456]",
					"[A24171, end, A26661, start, 0, 268435456]",
					"[A24171, end, A17110, start, 0, 268435456]",
					"[A24171, end, A19220, start, 0, 268435456]",
					"[A24171, end, A18169, start, 0, 268435456]",
					"[A24171, end, A23836, start, 0, 268435456]",
					"[A24171, end, A18595, start, 0, 268435456]",
					"[A24171, end, A28888, start, 0, 268435456]",
					"[A24171, end, A27244, start, 0, 268435456]",
					"[A24171, end, A85929, start, 0, 268435456]",
					"[A24171, end, A26795, start, 0, 268435456]",
					"[A24171, end, A27863, start, 0, 268435456]",
					"[A24171, end, A26054, start, 0, 268435456]",
					"[A24171, end, A24434, start, 0, 268435456]",
					"[A24171, end, A30321, start, 0, 268435456]",
					"[A24171, end, A15669, start, -268435456, 1500]",
					"[A24434, end, A18595, start, 0, 268435456]",
					"[A24434, end, A18616, start, 0, 268435456]",
					"[A24434, end, A32948, start, 0, 268435456]",
					"[A24434, end, A27863, start, 0, 268435456]",
					"[A23836, start, A24434, start, 0, 0]",
					"[A24434, end, A17110, start, 0, 268435456]",
					"[A24434, end, A85929, start, 0, 268435456]",
					"[A24434, end, A30321, start, 0, 268435456]",
					"[A24434, end, A28888, start, 0, 268435456]",
					"[A24434, end, A10860, start, 0, 268435456]",
					"[A24434, end, A26054, start, 0, 268435456]",
					"[A24434, end, A11293, start, 0, 268435456]",
					"[A24434, end, A18169, start, 0, 268435456]",
					"[A24434, end, A16040, start, 0, 268435456]",
					"[A24434, end, A26795, start, 0, 268435456]",
					"[A24434, end, A10821, start, 0, 268435456]",
					"[A23587, end, A24434, start, 0, 268435456]",
					"[A19597, end, A24434, start, 0, 268435456]",
					"[A23065, end, A24434, start, 0, 268435456]",
					"[A15669, end, A24434, start, 0, 268435456]",
					"[A31177, end, A24434, start, 0, 268435456]",
					"[A20797, end, A24434, start, 0, 268435456]",
					"[A10233, end, A24434, start, 0, 268435456]",
					"[A24171, end, A24434, start, 0, 268435456]",
					"[A31854, end, A24434, start, 0, 268435456]",
					"[A25839, end, A24434, start, 0, 268435456]",
					"[A25664, end, A24434, start, 0, 268435456]",
					"[A10233, end, A28888, start, 0, 268435456]",
					"[A10233, end, A30321, start, 0, 268435456]",
					"[A10233, end, A26661, start, 0, 268435456]",
					"[A10233, end, A11293, start, 0, 268435456]",
					"[A10233, end, A85929, start, 0, 268435456]",
					"[A10233, end, A32948, start, 0, 268435456]",
					"[A10233, end, A10821, start, 0, 268435456]",
					"[A10233, end, A27244, start, 0, 268435456]",
					"[A10233, end, A26054, start, 0, 268435456]",
					"[A10233, end, A16040, start, 0, 268435456]",
					"[A10233, end, A18169, start, 0, 268435456]",
					"[A10233, end, A23836, start, 0, 268435456]",
					"[A10233, end, A19220, start, 0, 268435456]",
					"[A10233, end, A10860, start, 0, 268435456]",
					"[A10233, end, A17110, start, 0, 268435456]",
					"[A10233, end, A18595, start, 0, 268435456]",
					"[A10233, end, A24434, start, 0, 268435456]",
					"[A10233, end, A26795, start, 0, 268435456]",
					"[A10233, end, A18616, start, 0, 268435456]",
					"[A10233, end, A27863, start, 0, 268435456]",
					"[A31854, end, A10233, start, 0, 268435456]",
					"[A20797, end, A10233, start, 0, 268435456]",
					"[A23065, end, A10233, start, 0, 268435456]",
					"[A23587, end, A10233, start, 0, 268435456]",
					"[A31177, end, A28888, start, 0, 268435456]",
					"[A31177, end, A19220, start, 0, 268435456]",
					"[A31177, end, A27244, start, 0, 268435456]",
					"[A31177, end, A26795, start, 0, 268435456]",
					"[A31177, end, A30321, start, 0, 268435456]",
					"[A31177, end, A85929, start, 0, 268435456]",
					"[A31177, end, A23836, start, 0, 268435456]",
					"[A31177, end, A24434, start, 0, 268435456]",
					"[A31177, end, A32948, start, 0, 268435456]",
					"[A31177, end, A27863, start, 0, 268435456]",
					"[A31177, end, A10821, start, 0, 268435456]",
					"[A31177, end, A11293, start, 0, 268435456]",
					"[A31177, end, A18616, start, 0, 268435456]",
					"[A19597, end, A31177, start, -268435456, 1500]",
					"[A31177, end, A16040, start, 0, 268435456]",
					"[A31177, end, A10860, start, 0, 268435456]",
					"[A31177, end, A17110, start, 0, 268435456]",
					"[A31177, end, A18595, start, 0, 268435456]",
					"[A31177, end, A18169, start, 0, 268435456]",
					"[A31177, end, A26661, start, 0, 268435456]",
					"[A31177, end, A26054, start, 0, 268435456]",
					"[A31177, end, A19597, start, -268435456, 1500]",
					"[A15669, end, A32948, start, 0, 268435456]",
					"[A15669, end, A23836, start, 0, 268435456]",
					"[A15669, end, A10821, start, 0, 268435456]",
					"[A15669, end, A11293, start, 0, 268435456]",
					"[A15669, end, A27244, start, 0, 268435456]",
					"[A24171, end, A15669, start, -268435456, 1500]",
					"[A15669, end, A30321, start, 0, 268435456]",
					"[A15669, end, A17110, start, 0, 268435456]",
					"[A15669, end, A26661, start, 0, 268435456]",
					"[A15669, end, A18169, start, 0, 268435456]",
					"[A15669, end, A27863, start, 0, 268435456]",
					"[A15669, end, A19220, start, 0, 268435456]",
					"[A15669, end, A85929, start, 0, 268435456]",
					"[A15669, end, A18595, start, 0, 268435456]",
					"[A15669, end, A24434, start, 0, 268435456]",
					"[A15669, end, A16040, start, 0, 268435456]",
					"[A15669, end, A18616, start, 0, 268435456]",
					"[A15669, end, A26054, start, 0, 268435456]",
					"[A15669, end, A28888, start, 0, 268435456]",
					"[A15669, end, A10860, start, 0, 268435456]",
					"[A15669, end, A26795, start, 0, 268435456]",
					"[A15669, end, A24171, start, -268435456, 1500]",
					"[A26795, end, A18616, start, 0, 268435456]",
					"[A26795, end, A30321, start, 0, 268435456]",
					"[A26795, end, A18169, start, 0, 268435456]",
					"[A26795, end, A11293, start, 0, 268435456]",
					"[A26795, end, A10821, start, 0, 268435456]",
					"[A26795, end, A17110, start, 0, 268435456]",
					"[A26795, end, A26054, start, 0, 268435456]",
					"[A26795, end, A16040, start, 0, 268435456]",
					"[A26795, end, A27863, start, 0, 268435456]",
					"[A26795, end, A10860, start, 0, 268435456]",
					"[A26795, end, A28888, start, 0, 268435456]",
					"[A26795, end, A32948, start, 0, 268435456]",
					"[A26795, end, A85929, start, 0, 268435456]",
					"[A26795, end, A18595, start, 0, 268435456]",
					"[A23587, end, A26795, start, 0, 268435456]",
					"[A31177, end, A26795, start, 0, 268435456]",
					"[A19597, end, A26795, start, 0, 268435456]",
					"[A25839, end, A26795, start, 0, 268435456]",
					"[A31854, end, A26795, start, 0, 268435456]",
					"[A25664, end, A26795, start, 0, 268435456]",
					"[A23836, end, A26795, start, 0, 268435456]",
					"[A27244, end, A26795, start, 0, 268435456]",
					"[A20797, end, A26795, start, 0, 268435456]",
					"[A23065, end, A26795, start, 0, 268435456]",
					"[A24171, end, A26795, start, 0, 268435456]",
					"[A10233, end, A26795, start, 0, 268435456]",
					"[A26661, end, A26795, start, 0, 268435456]",
					"[A24434, end, A26795, start, 0, 268435456]",
					"[A15669, end, A26795, start, 0, 268435456]",
					"[A19220, end, A26795, start, 0, 268435456]",
					"[A10860, end, A18616, start, -268435456, 1500]",
					"[A26795, end, A18616, start, 0, 268435456]",
					"[A23836, end, A18616, start, 0, 268435456]",
					"[A24434, end, A18616, start, 0, 268435456]",
					"[A23587, end, A18616, start, 0, 268435456]",
					"[A20797, end, A18616, start, 0, 268435456]",
					"[A25664, end, A18616, start, 0, 268435456]",
					"[A24171, end, A18616, start, 0, 268435456]",
					"[A19220, end, A18616, start, 0, 268435456]",
					"[A26661, end, A18616, start, 0, 268435456]",
					"[A31177, end, A18616, start, 0, 268435456]",
					"[A18616, end, A10860, start, -268435456, 1500]",
					"[A31854, end, A18616, start, 0, 268435456]",
					"[A27244, end, A18616, start, 0, 268435456]",
					"[A15669, end, A18616, start, 0, 268435456]",
					"[A19597, end, A18616, start, 0, 268435456]",
					"[A10233, end, A18616, start, 0, 268435456]",
					"[A32948, end, A18616, start, 0, 268435456]",
					"[A23065, end, A18616, start, 0, 268435456]",
					"[A25839, end, A18616, start, 0, 268435456]",
					"[A25839, end, A27863, start, 0, 268435456]",
					"[A25839, end, A16040, start, 0, 268435456]",
					"[A25839, end, A26795, start, 0, 268435456]",
					"[A25839, end, A30321, start, 0, 268435456]",
					"[A25839, end, A11293, start, 0, 268435456]",
					"[A25839, end, A23836, start, 0, 268435456]",
					"[A25839, end, A10821, start, 0, 268435456]",
					"[A25839, end, A19220, start, 0, 268435456]",
					"[A25839, end, A28888, start, 0, 268435456]",
					"[A25839, end, A24434, start, 0, 268435456]",
					"[A25839, end, A27244, start, 0, 268435456]",
					"[A25839, end, A85929, start, 0, 268435456]",
					"[A25839, end, A32948, start, 0, 268435456]",
					"[A25839, end, A10860, start, 0, 268435456]",
					"[A25839, end, A18595, start, 0, 268435456]",
					"[A25664, end, A25839, start, -268435456, 1500]",
					"[A25839, end, A18169, start, 0, 268435456]",
					"[A25839, end, A26661, start, 0, 268435456]",
					"[A25839, end, A17110, start, 0, 268435456]",
					"[A25839, end, A26054, start, 0, 268435456]",
					"[A25839, end, A18616, start, 0, 268435456]",
					"[A25839, end, A25664, start, -268435456, 1500]",
					"[A23587, end, A16040, start, 0, 268435456]",
					"[A25839, end, A16040, start, 0, 268435456]",
					"[A26661, end, A16040, start, 0, 268435456]",
					"[A20797, end, A16040, start, 0, 268435456]",
					"[A23065, end, A16040, start, 0, 268435456]",
					"[A27244, end, A16040, start, 0, 268435456]",
					"[A24171, end, A16040, start, 0, 268435456]",
					"[A25664, end, A16040, start, 0, 268435456]",
					"[A31854, end, A16040, start, 0, 268435456]",
					"[A10233, end, A16040, start, 0, 268435456]",
					"[A31177, end, A16040, start, 0, 268435456]",
					"[A26795, end, A16040, start, 0, 268435456]",
					"[A19220, end, A16040, start, 0, 268435456]",
					"[A15669, end, A16040, start, 0, 268435456]",
					"[A23836, end, A16040, start, 0, 268435456]",
					"[A19597, end, A16040, start, 0, 268435456]",
					"[A24434, end, A16040, start, 0, 268435456]",
					"[A32948, end, A16040, start, 0, 268435456]",
					"[A85929, end, A11293, start, -268435456, 1500]",
					"[A23065, end, A11293, start, 0, 268435456]",
					"[A32948, end, A11293, start, 0, 268435456]",
					"[A11293, end, A85929, start, -268435456, 1500]",
					"[A24171, end, A11293, start, 0, 268435456]",
					"[A19220, end, A11293, start, 0, 268435456]",
					"[A27244, end, A11293, start, 0, 268435456]",
					"[A15669, end, A11293, start, 0, 268435456]",
					"[A25839, end, A11293, start, 0, 268435456]",
					"[A10233, end, A11293, start, 0, 268435456]",
					"[A26795, end, A11293, start, 0, 268435456]",
					"[A31854, end, A11293, start, 0, 268435456]",
					"[A31177, end, A11293, start, 0, 268435456]",
					"[A23836, end, A11293, start, 0, 268435456]",
					"[A20797, end, A11293, start, 0, 268435456]",
					"[A19597, end, A11293, start, 0, 268435456]",
					"[A26661, end, A11293, start, 0, 268435456]",
					"[A24434, end, A11293, start, 0, 268435456]",
					"[A23587, end, A11293, start, 0, 268435456]",
					"[A25664, end, A11293, start, 0, 268435456]",
					"[A30120, start, A42428, start, 0, 0]",
					"[A19220, end, A18169, start, 0, 268435456]",
					"[A23836, end, A18169, start, 0, 268435456]",
					"[A20797, end, A18169, start, 0, 268435456]",
					"[A25664, end, A18169, start, 0, 268435456]",
					"[A26661, end, A18169, start, 0, 268435456]",
					"[A23587, end, A18169, start, 0, 268435456]",
					"[A26795, end, A18169, start, 0, 268435456]",
					"[A32948, end, A18169, start, 0, 268435456]",
					"[A19597, end, A18169, start, 0, 268435456]",
					"[A15669, end, A18169, start, 0, 268435456]",
					"[A23065, end, A18169, start, 0, 268435456]",
					"[A24171, end, A18169, start, 0, 268435456]",
					"[A25839, end, A18169, start, 0, 268435456]",
					"[A10233, end, A18169, start, 0, 268435456]",
					"[A31854, end, A18169, start, 0, 268435456]",
					"[A31177, end, A18169, start, 0, 268435456]",
					"[A24434, end, A18169, start, 0, 268435456]",
					"[A27244, end, A18169, start, 0, 268435456]",
					"[A31854, end, A10860, start, 0, 268435456]",
					"[A31854, end, A28888, start, 0, 268435456]",
					"[A31854, end, A18595, start, 0, 268435456]",
					"[A31854, end, A23836, start, 0, 268435456]",
					"[A31854, end, A24434, start, 0, 268435456]",
					"[A31854, end, A11293, start, 0, 268435456]",
					"[A31854, end, A17110, start, 0, 268435456]",
					"[A31854, end, A27863, start, 0, 268435456]",
					"[A31854, end, A85929, start, 0, 268435456]",
					"[A31854, end, A10233, start, 0, 268435456]",
					"[A31854, end, A10821, start, 0, 268435456]",
					"[A31854, end, A16040, start, 0, 268435456]",
					"[A31854, end, A26795, start, 0, 268435456]",
					"[A31854, end, A26661, start, 0, 268435456]",
					"[A31854, end, A18616, start, 0, 268435456]",
					"[A31854, end, A19220, start, 0, 268435456]",
					"[A31854, end, A27244, start, 0, 268435456]",
					"[A31854, end, A18169, start, 0, 268435456]",
					"[A31854, end, A30321, start, 0, 268435456]",
					"[A31854, end, A32948, start, 0, 268435456]",
					"[A31854, end, A26054, start, 0, 268435456]",
					"[A20797, end, A31854, start, 0, 268435456]",
					"[A23587, end, A31854, start, 0, 268435456]",
					"[A23065, end, A31854, start, 0, 268435456]",
					"[A23836, end, A30321, start, 0, 268435456]",
					"[A26795, end, A30321, start, 0, 268435456]",
					"[A20797, end, A30321, start, 0, 268435456]",
					"[A10233, end, A30321, start, 0, 268435456]",
					"[A25664, end, A30321, start, 0, 268435456]",
					"[A31177, end, A30321, start, 0, 268435456]",
					"[A25839, end, A30321, start, 0, 268435456]",
					"[A24434, end, A30321, start, 0, 268435456]",
					"[A15669, end, A30321, start, 0, 268435456]",
					"[A19597, end, A30321, start, 0, 268435456]",
					"[A19220, end, A30321, start, 0, 268435456]",
					"[A26661, end, A30321, start, 0, 268435456]",
					"[A32948, end, A30321, start, 0, 268435456]",
					"[A23065, end, A30321, start, 0, 268435456]",
					"[A31854, end, A30321, start, 0, 268435456]",
					"[A24171, end, A30321, start, 0, 268435456]",
					"[A27244, end, A30321, start, 0, 268435456]",
					"[A23587, end, A30321, start, 0, 268435456]",
					"[A23587, end, A26795, start, 0, 268435456]",
					"[A23587, end, A27863, start, 0, 268435456]",
					"[A23587, end, A16040, start, 0, 268435456]",
					"[A23587, end, A10821, start, 0, 268435456]",
					"[A23587, end, A19220, start, 0, 268435456]",
					"[A23587, end, A18169, start, 0, 268435456]",
					"[A23587, end, A18595, start, 0, 268435456]",
					"[A23587, end, A24434, start, 0, 268435456]",
					"[A23587, end, A10860, start, 0, 268435456]",
					"[A23587, end, A26054, start, 0, 268435456]",
					"[A23587, end, A23836, start, 0, 268435456]",
					"[A23587, end, A30321, start, 0, 268435456]",
					"[A23587, end, A23065, start, 0, 268435456]",
					"[A23587, end, A18616, start, 0, 268435456]",
					"[A23587, end, A85929, start, 0, 268435456]",
					"[A23587, end, A26661, start, 0, 268435456]",
					"[A23587, end, A32948, start, 0, 268435456]",
					"[A23587, end, A10233, start, 0, 268435456]",
					"[A23587, end, A17110, start, 0, 268435456]",
					"[A23587, end, A28888, start, 0, 268435456]",
					"[A23587, end, A11293, start, 0, 268435456]",
					"[A23587, end, A31854, start, 0, 268435456]",
					"[A23587, end, A27244, start, 0, 268435456]",
					"[A20797, end, A23587, start, 0, 268435456]",
					"[A20797, end, A31854, start, 0, 268435456]",
					"[A20797, end, A18169, start, 0, 268435456]",
					"[A20797, end, A30321, start, 0, 268435456]",
					"[A20797, end, A27244, start, 0, 268435456]",
					"[A20797, end, A10860, start, 0, 268435456]",
					"[A20797, end, A28888, start, 0, 268435456]",
					"[A20797, end, A11293, start, 0, 268435456]",
					"[A20797, end, A10821, start, 0, 268435456]",
					"[A20797, end, A10233, start, 0, 268435456]",
					"[A20797, end, A24434, start, 0, 268435456]",
					"[A20797, end, A23065, start, 0, 268435456]",
					"[A20797, end, A18616, start, 0, 268435456]",
					"[A20797, end, A17110, start, 0, 268435456]",
					"[A20797, end, A16040, start, 0, 268435456]",
					"[A20797, end, A26661, start, 0, 268435456]",
					"[A20797, end, A19220, start, 0, 268435456]",
					"[A20797, end, A32948, start, 0, 268435456]",
					"[A20797, end, A23836, start, 0, 268435456]",
					"[A20797, end, A18595, start, 0, 268435456]",
					"[A20797, end, A85929, start, 0, 268435456]",
					"[A20797, end, A23587, start, 0, 268435456]",
					"[A20797, end, A26795, start, 0, 268435456]",
					"[A20797, end, A26054, start, 0, 268435456]",
					"[A20797, end, A27863, start, 0, 268435456]",
					"[A26661, end, A18169, start, 0, 268435456]",
					"[A26661, end, A16040, start, 0, 268435456]",
					"[A26661, end, A10860, start, 0, 268435456]",
					"[A26661, end, A28888, start, 0, 268435456]",
					"[A27244, start, A26661, start, 0, 0]",
					"[A26661, end, A30321, start, 0, 268435456]",
					"[A26661, end, A18616, start, 0, 268435456]",
					"[A26661, end, A32948, start, 0, 268435456]",
					"[A26661, end, A10821, start, 0, 268435456]",
					"[A26661, end, A17110, start, 0, 268435456]",
					"[A26661, end, A27863, start, 0, 268435456]",
					"[A26661, end, A11293, start, 0, 268435456]",
					"[A26661, end, A18595, start, 0, 268435456]",
					"[A26661, end, A85929, start, 0, 268435456]",
					"[A26661, end, A26795, start, 0, 268435456]",
					"[A26661, end, A26054, start, 0, 268435456]",
					"[A24171, end, A26661, start, 0, 268435456]",
					"[A31854, end, A26661, start, 0, 268435456]",
					"[A23587, end, A26661, start, 0, 268435456]",
					"[A10233, end, A26661, start, 0, 268435456]",
					"[A25839, end, A26661, start, 0, 268435456]",
					"[A25664, end, A26661, start, 0, 268435456]",
					"[A19597, end, A26661, start, 0, 268435456]",
					"[A23065, end, A26661, start, 0, 268435456]",
					"[A20797, end, A26661, start, 0, 268435456]",
					"[A15669, end, A26661, start, 0, 268435456]",
					"[A31177, end, A26661, start, 0, 268435456]",
					"[A27244, end, A26054, start, 0, 268435456]",
					"[A23065, end, A26054, start, 0, 268435456]",
					"[A10233, end, A26054, start, 0, 268435456]",
					"[A32948, end, A26054, start, 0, 268435456]",
					"[A26795, end, A26054, start, 0, 268435456]",
					"[A24434, end, A26054, start, 0, 268435456]",
					"[A23836, end, A26054, start, 0, 268435456]",
					"[A19597, end, A26054, start, 0, 268435456]",
					"[A23587, end, A26054, start, 0, 268435456]",
					"[A15669, end, A26054, start, 0, 268435456]",
					"[A20797, end, A26054, start, 0, 268435456]",
					"[A19220, end, A26054, start, 0, 268435456]",
					"[A25664, end, A26054, start, 0, 268435456]",
					"[A24171, end, A26054, start, 0, 268435456]",
					"[A26661, end, A26054, start, 0, 268435456]",
					"[A31854, end, A26054, start, 0, 268435456]",
					"[A25839, end, A26054, start, 0, 268435456]",
					"[A31177, end, A26054, start, 0, 268435456]",
					"[A23836, end, A10821, start, 0, 268435456]",
					"[A19220, end, A10821, start, 0, 268435456]",
					"[A23587, end, A10821, start, 0, 268435456]",
					"[A15669, end, A10821, start, 0, 268435456]",
					"[A24171, end, A10821, start, 0, 268435456]",
					"[A23065, end, A10821, start, 0, 268435456]",
					"[A32948, end, A10821, start, 0, 268435456]",
					"[A27244, end, A10821, start, 0, 268435456]",
					"[A25839, end, A10821, start, 0, 268435456]",
					"[A10233, end, A10821, start, 0, 268435456]",
					"[A25664, end, A10821, start, 0, 268435456]",
					"[A31177, end, A10821, start, 0, 268435456]",
					"[A26795, end, A10821, start, 0, 268435456]",
					"[A26661, end, A10821, start, 0, 268435456]",
					"[A31854, end, A10821, start, 0, 268435456]",
					"[A20797, end, A10821, start, 0, 268435456]",
					"[A19597, end, A10821, start, 0, 268435456]",
					"[A24434, end, A10821, start, 0, 268435456]",
					"[A23065, end, A11293, start, 0, 268435456]",
					"[A23065, end, A32948, start, 0, 268435456]",
					"[A23065, end, A26054, start, 0, 268435456]",
					"[A23065, end, A10821, start, 0, 268435456]",
					"[A23065, end, A27863, start, 0, 268435456]",
					"[A23065, end, A16040, start, 0, 268435456]",
					"[A23065, end, A17110, start, 0, 268435456]",
					"[A23065, end, A10860, start, 0, 268435456]",
					"[A23065, end, A26661, start, 0, 268435456]",
					"[A23065, end, A31854, start, 0, 268435456]",
					"[A23065, end, A23836, start, 0, 268435456]",
					"[A23065, end, A19220, start, 0, 268435456]",
					"[A23065, end, A27244, start, 0, 268435456]",
					"[A23065, end, A30321, start, 0, 268435456]",
					"[A23065, end, A28888, start, 0, 268435456]",
					"[A23065, end, A18169, start, 0, 268435456]",
					"[A23065, end, A24434, start, 0, 268435456]",
					"[A23065, end, A10233, start, 0, 268435456]",
					"[A23065, end, A26795, start, 0, 268435456]",
					"[A23065, end, A18595, start, 0, 268435456]",
					"[A23065, end, A85929, start, 0, 268435456]",
					"[A23065, end, A18616, start, 0, 268435456]",
					"[A20797, end, A23065, start, 0, 268435456]",
					"[A23587, end, A23065, start, 0, 268435456]",
					"[A24434, end, A18595, start, 0, 268435456]",
					"[A19597, end, A18595, start, 0, 268435456]",
					"[A23836, end, A18595, start, 0, 268435456]",
					"[A31854, end, A18595, start, 0, 268435456]",
					"[A32948, end, A18595, start, 0, 268435456]",
					"[A25664, end, A18595, start, 0, 268435456]",
					"[A23587, end, A18595, start, 0, 268435456]",
					"[A19220, end, A18595, start, 0, 268435456]",
					"[A15669, end, A18595, start, 0, 268435456]",
					"[A25839, end, A18595, start, 0, 268435456]",
					"[A20797, end, A18595, start, 0, 268435456]",
					"[A27244, end, A18595, start, 0, 268435456]",
					"[A24171, end, A18595, start, 0, 268435456]",
					"[A31177, end, A18595, start, 0, 268435456]",
					"[A10233, end, A18595, start, 0, 268435456]",
					"[A26661, end, A18595, start, 0, 268435456]",
					"[A23065, end, A18595, start, 0, 268435456]",
					"[A26795, end, A18595, start, 0, 268435456]",
					"[A30120, end, A22935, start, 0, 0]",
					"[A25886, start, A18735, start, 0, 0]",
					"[A23836, end, A10821, start, 0, 268435456]",
					"[A23836, end, A30321, start, 0, 268435456]",
					"[A23836, end, A18169, start, 0, 268435456]",
					"[A23836, end, A18616, start, 0, 268435456]",
					"[A23836, end, A18595, start, 0, 268435456]",
					"[A23836, end, A17110, start, 0, 268435456]",
					"[A23836, end, A11293, start, 0, 268435456]",
					"[A23836, end, A10860, start, 0, 268435456]",
					"[A23836, end, A85929, start, 0, 268435456]",
					"[A23836, end, A26054, start, 0, 268435456]",
					"[A23836, end, A26795, start, 0, 268435456]",
					"[A23836, end, A32948, start, 0, 268435456]",
					"[A23836, end, A16040, start, 0, 268435456]",
					"[A23836, end, A27863, start, 0, 268435456]",
					"[A23836, end, A28888, start, 0, 268435456]",
					"[A15669, end, A23836, start, 0, 268435456]",
					"[A23836, start, A24434, start, 0, 0]",
					"[A31177, end, A23836, start, 0, 268435456]",
					"[A25839, end, A23836, start, 0, 268435456]",
					"[A31854, end, A23836, start, 0, 268435456]",
					"[A23065, end, A23836, start, 0, 268435456]",
					"[A20797, end, A23836, start, 0, 268435456]",
					"[A24171, end, A23836, start, 0, 268435456]",
					"[A10233, end, A23836, start, 0, 268435456]",
					"[A25664, end, A23836, start, 0, 268435456]",
					"[A19597, end, A23836, start, 0, 268435456]",
					"[A23587, end, A23836, start, 0, 268435456]",
					"[A25886, start, A18735, start, 0, 0]",
					"[A31177, end, A28888, start, 0, 268435456]",
					"[A10233, end, A28888, start, 0, 268435456]",
					"[A31854, end, A28888, start, 0, 268435456]",
					"[A27244, end, A28888, start, 0, 268435456]",
					"[A25664, end, A28888, start, 0, 268435456]",
					"[A24434, end, A28888, start, 0, 268435456]",
					"[A19597, end, A28888, start, 0, 268435456]",
					"[A26661, end, A28888, start, 0, 268435456]",
					"[A25839, end, A28888, start, 0, 268435456]",
					"[A20797, end, A28888, start, 0, 268435456]",
					"[A23065, end, A28888, start, 0, 268435456]",
					"[A23587, end, A28888, start, 0, 268435456]",
					"[A24171, end, A28888, start, 0, 268435456]",
					"[A32948, end, A28888, start, 0, 268435456]",
					"[A26795, end, A28888, start, 0, 268435456]",
					"[A15669, end, A28888, start, 0, 268435456]",
					"[A19220, end, A28888, start, 0, 268435456]",
					"[A23836, end, A28888, start, 0, 268435456]"
			};
	
	    public static String[] implicitInfo = {
					"[A15669, end, A24171, start, 0, 268435456]",
					"[A24171, end, A25839, start, 0, 268435456]",
					"[A25839, end, A25664, start, 0, 268435456]",
					"[A25664, end, A19597, start, 0, 268435456]",
					"[A19597, end, A31177, start, 0, 268435456]",
					"[A31177, end, A30321, start, 0, 268435456]",
					"[A30321, end, A85929, start, 0, 268435456]",
					"[A85929, end, A22935, start, 0, 268435456]",
					"[A22935, end, A10860, start, 0, 268435456]",
					"[A10860, end, A11293, start, 0, 268435456]",
					"[A11293, end, A18616, start, 0, 268435456]",
					"[A18616, end, A27863, start, 0, 268435456]",
					"[A27863, end, A58474, start, 0, 268435456]",
					"[A20797, end, A23065, start, 0, 268435456]",
					"[A23587, end, A31854, start, 0, 268435456]",
					"[A31854, end, A26795, start, 0, 268435456]",
					"[A26795, end, A26054, start, 0, 268435456]",
					"[A26054, end, A18169, start, 0, 268435456]",
					"[A19220, end, A28888, start, 0, 268435456]",
					"[A28888, end, A17110, start, 0, 268435456]",
					"[ROVER_, end, A32948, start, 0, 268435456]",
					"[A24434, end, A26661, start, 0, 268435456]",
					"[A26661, end, A16040, start, 0, 268435456]",
					"[A16040, end, A18595, start, 0, 268435456]",
					"[A18595, end, A30120, start, 0, 268435456]",
					"[A30120, end, A10821, start, 0, 268435456]",
					"[A10821, end, A18735, start, 0, 268435456]",
					"[A18735, end, A93062, start, 0, 268435456]",
					"[A23836, end, A27244, start, 0, 268435456]",
					"[A27244, end, A42428, start, 0, 268435456]",
					"[A42428, end, A25886, start, 0, 268435456]"
			};
	
	    public static String[] registerInfo_inconsistent = {
		        "[A23587, 130796588, 49, HAZCAM_FRONT, CATEGORY]",
				"[A31854, 130797520, 49, HAZCAM_FRONT, CATEGORY]",
				"[A26795, 130803261, 99, HAZCAM_FRONT, CATEGORY]"
		};
	
	    public static String[] temporalBoundInfo_inconsistent = {
			    "[A26795, start, 130799715, 268435456]",
		        };
		
	    public static String[] temporalRelationInfo_inconsistent = {
			    "[A23587, end, A31854, start, 0, 10]",
				"[A31854, end, A26795, start, 0, 10]",
				"[A26795, end, A23587, start, 0, 10]"
	    };
	}
    private static class BasicScenario {
    	public static String[] registerInfo_basic = {
			"[UNSTOW_1, 1, 600, IDD_UNSTOW, IDD]",
			"[MOVE_1, 1000, 480, IDD_MOVE, IDD]"
    	};
    	public static String[] temporalBoundInfo_basic = {
		    "[UNSTOW_1, start, 0, 268435456]"
        };
    	@SuppressWarnings("unused")
		public static String[] temporalRelationInfo_basic = {
			"[UNSTOW_1, start, MOVE_1, start, 1, 1]"
        };
    }

    @BeforeClass
    static public void startServer() throws Exception {
		Bundle bundle = EuropaPlugin.getDefault().getBundle();
		
		EuropaServerManager.createDirInStateArea("europa-test");
		EuropaServerManager.copyFileToStateArea("data/test/MER2-initial-state.nddl", "europa-test" + File.separator + "MER2-initial-state.nddl", bundle);
		EuropaServerManager.copyFileToStateArea("data/test/MER2-model.nddl", "europa-test" + File.separator + "MER2-model.nddl", bundle);
		EuropaServerManager.copyFileToStateArea("data/test/NDDL.cfg", "europa-test" + File.separator + "NDDL.cfg", bundle);
		EuropaServerManager.copyFileToStateArea("data/test/SolverConfig.xml", "europa-test" + File.separator + "SolverConfig.xml", bundle);
		EuropaServerManager.copyFileToStateArea("data/test/TestEuropaServerManager.xml", "europa-test" + File.separator + "TestEuropaServerManager.xml", bundle);
		
		
		String absolutePath = EuropaServerManager.localStatePath().append("europa-test").toOSString();
		Map<String, String> replacements = new TreeMap<String, String>();
		replacements.put("\\$", absolutePath);
		
		String testEuropaServerManager = EuropaServerManager.localStatePath().append("europa-test").append("TestEuropaServerManager.xml").toString();
		EuropaServerManager.startServerManager(testEuropaServerManager, replacements, true, bundle);
    }
    
    @AfterClass
    static public void stopServer() throws Exception {
		EuropaServerManager.stopServerManager(); 
		EuropaServerManager.clearLocalStateArea();
    }
    
    @Before
    public void setUp() throws Exception {
		temporalBoundConstraints = new HashMap<String,String>();
		temporalRelationConstraints = new HashMap<String,String>();
    	EuropaPlugin.getDefault().getPreferenceStore().putValue("gov.nasa.arc.spife.europa.host", "localhost");
		EuropaPlugin.getDefault().getPreferenceStore().putValue("gov.nasa.arc.spife.europa.junit.host", "localhost");
	   	EuropaPlugin.getDefault().getPreferenceStore().setValue("gov.nasa.arc.spife.europa.port", EuropaPreferences.getEuropaPort());
		EuropaPlugin.getDefault().getPreferenceStore().setValue("gov.nasa.arc.spife.europa.junit.port", EuropaPreferences.getEuropaPort());
		EuropaPlugin.getDefault().getPreferenceStore().setValue("gov.nasa.arc.spife.europa.modelname", "MER2");
		EuropaPlugin.getDefault().getPreferenceStore().setValue("gov.nasa.arc.spife.europa.junit.modelname", "MER2");

		host = EuropaPreferences.getEuropaHost();
		port = EuropaPreferences.getEuropaPort();
    	trace.info("Testing with URL: "+ host + ":" + port);		
    }
	
    @After
	public void tearDown() throws Exception {
		temporalBoundConstraints = null;
		temporalRelationConstraints = null;
	}

	/**
	 * Inconsistent network test.
	 * @throws ClientException
	 */
    @Test
	public void testInconsistent() {
		trace.info("*** Inconsistent network test ***");
		EuropaSessionClient client = getTestClient();
		@SuppressWarnings("unused") Object result;
		try {
			result = registerActivities(client, TestScenario.registerInfo_inconsistent);
			result = addTemporalBoundConstraint(client, TestScenario.temporalBoundInfo_inconsistent);
			result = addTemporalRelationConstraint(client, TestScenario.temporalRelationInfo_inconsistent);
			checkConsistency(client);
		} 
		finally {
			client.disconnect();
	    }
	}
		
	String testNogood = "[{point=start, key=[A26795, end, A23587, start, 0, 10], length=0, activity=A23587}, " +
                        " {point=end, key=DURATION, length=-99, activity=A26795}, " +
                        " {point=start, key=[A31854, end, A26795, start, 0, 10], length=0, activity=A26795}, " +
                        " {point=end, key=DURATION, length=-49, activity=A31854}, " +
                        " {point=start, key=[A23587, end, A31854, start, 0, 10], length=0, activity=A31854}, " +
                        " {point=end, key=DURATION, length=-49, activity=A23587}]";
	
	//FAILS?
	/**
	 * 
	 * @throws Exception
	 */
	@Test
	public void testDB() {
		trace.info("*** Sessions testing ***");
		int counterEnd = 1;
		for (int counter = 0; counter < counterEnd; counter++) {
			EuropaSessionClient client = getTestClient();
			Object result;
			try {
				result = registerActivities(client, TestScenario.registerInfo);
				result = addTemporalBoundConstraint(client, TestScenario.temporalBoundInfo);
				result = addTemporalRelationConstraint(client, TestScenario.temporalRelationInfo);
				result = addTemporalRelationConstraint(client, TestScenario.implicitInfo);

				// Check for consistency
				boolean isConsistent = client.isConsistent();
				if (isConsistent) {
					trace.info("Network consistent");
				} else {
					trace.info("Network inconsistent");
					result = execute(client, EuropaCommand.GET_NOGOOD, true);
					trace.info(result);
				}
			} 
			finally {
				client.disconnect();
			}
		}
	}

	@Test
	public void testModifications() {
//		try{Thread.sleep(3000);}catch(Exception e){}
		trace.info("*** Modifying duration test ***");
		EuropaSessionClient client = getTestClient();
		Object result;
		try {
			result = registerActivities(client, TestScenario.registerInfo);
			result = addTemporalBoundConstraint(client, TestScenario.temporalBoundInfo);
			result = addTemporalRelationConstraint(client, TestScenario.temporalRelationInfo);

			int tempRelSize = temporalRelationConstraints.size();
			int tempBoundSize = temporalBoundConstraints.size();
			trace.info("There are this many temporalRelations: " + tempRelSize);
			trace.info("There are this many temporalBounds: " + tempBoundSize);
			
			// Check for consistency
			boolean isConsistent = client.isConsistent();
			if (isConsistent) {
				trace.info("Network consistent");
				Vector<Object> act = new Vector<Object>();
				act.add("A19597");
//				act.add("A26795");
				Map rawConstraintsStart = (Map)execute(client, EuropaCommand.GET_ACTIVITY_CONSTRAINTS, act, true);
				Vector<Object> mods = new Vector<Object>();
				mods.add("A19597");
//				mods.add("A26795");
				mods.add(10);
				result = execute(client, EuropaCommand.UPDATE_ACTIVITY_DURATION, mods, true);
				trace.info("Sending to UpdateActivityDuration  : " + mods);
				trace.info("Results from UpdateActivityDuration: " + result);
				Map constraints1 = (Map)execute(client, EuropaCommand.GET_ACTIVITY_CONSTRAINTS, act, true);
				mods = new Vector<Object>();
				mods.add("A19597");
//				mods.add("A26795");
//				mods.add("A17110");
				mods.add(30);
				result = execute(client, EuropaCommand.UPDATE_ACTIVITY_DURATION, mods, true);
				trace.info("Sending to UpdateActivityDuration  : " + mods);
				trace.info("Results from UpdateActivityDuration: " + result);
				Map constraints2 = (Map)execute(client, EuropaCommand.GET_ACTIVITY_CONSTRAINTS, act, true);
				trace.info("start: " + rawConstraintsStart);
				trace.info("mod 1: " + constraints1);
				trace.info("mod 2: " + constraints2);
			} else {
				trace.info("Network inconsistent");
				result = execute(client, EuropaCommand.GET_NOGOOD, true);
				trace.info(result);
			}
		} finally {
			client.disconnect();
		}
	}

	@SuppressWarnings("unused")
	@Test
    public void testSetActivity() {
//    	try{Thread.sleep(3000);}catch(Exception e){}
		trace.info("*** Set start time and params test ***");
		EuropaSessionClient client = getTestClient();
		@SuppressWarnings("unused") Object result;
		try {
			registerActivities(client, registerInfo_test);

//	    	as.setActivityStartTime("UNSTOW_1",1);
			Vector<Object> setStarttime = new Vector<Object>();
			setStarttime.add("UNSTOW_1");
			setStarttime.add(1);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
			if (true) {
				return;
			}
			
//	    	as.setActivityParamValue("UNSTOW_1","crit_data_vol",50);
			List<? extends Object> parameters;
			parameters = Arrays.<Object>asList("UNSTOW_1", "crit_data_vol", 50, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);

//	    	as.setActivityStartTime("MOVE_1",10);
			parameters = Arrays.<Object>asList("MOVE_1", 10);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	as.setActivityParamValue("MOVE_1","crit_data_vol",50);
			parameters = Arrays.<Object>asList("MOVE_1", "crit_data_vol", 50, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);

//	    	// Following is inconsistent only with start times, which are only
//	    	// used when checking passively for flight violations.
//	    	as.addTemporalRelationConstraint("UNSTOW_1",start,"MOVE_1",start,
//	    	                                   1,1,"Test_Constraint");
			String[] temporalRelationInfo = { "[UNSTOW_1, start, MOVE_1, start, 1, 1]" };
			addTemporalRelationConstraint(client, temporalRelationInfo);

//	    	as.setActivityStartTime("MOVE_2",1000);
			setStarttime = new Vector<Object>();
			setStarttime.add("MOVE_2");
			setStarttime.add(1000);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	as.setActivityParamValue("MOVE_2","crit_data_vol",50);
			parameters = Arrays.<Object>asList("MOVE_2", "crit_data_vol", 50, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);

//	    	as.setActivityStartTime("APXS_1",1);
			setStarttime = new Vector<Object>();
			setStarttime.add("APXS_1");
			setStarttime.add(1);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	as.setActivityParamValue("APXS_1","start_dur",180);
			parameters = Arrays.<Object>asList("APXS_1", "start_dur", 180, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);

//	    	as.setActivityParamValue("APXS_1","acq_dur",1800);
			parameters = Arrays.<Object>asList("APXS_1", "acq_dur", 1800, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);
			
//	    	as.setActivityParamValue("APXS_1","off_dur",360);
			parameters = Arrays.<Object>asList("APXS_1", "off_dur", 360, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);
//	    	as.setActivityParamValue("APXS_1","crit_data_vol",100);
			
			parameters = Arrays.<Object>asList("APXS_1", "crit_data_vol", 100, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);
//	    	as.setActivityParamValue("APXS_1","noncrit_data_vol",500);

			parameters = Arrays.<Object>asList("APXS_1", "noncrit_data_vol", 500, "int");
			sendData(client, EuropaCommand.SET_ACTIVITY_PARAM_VALUE, parameters);
			
			// Check for consistency
			int isConsistent = (Integer) execute(client, EuropaCommand.IS_CONSISTENT, true);
			if (isConsistent == 1) {
				trace.info("Network consistent");
			} else {
				trace.info("Network inconsistent");
				Object inconsistencies = execute(client, EuropaCommand.GET_NOGOOD, true);
				trace.info("Inconsistencies: " + inconsistencies);
				// Check for violations
				Object violations = execute(client, EuropaCommand.GET_VIOLATIONS, true);
				trace.info("Violations: '" + violations + "'");
			}
		} finally {
			client.disconnect();
		}
    }
    
    private String[] registerInfo_flight_rule_violation = {
			"[UNSTOW_1, 1, 600, IDD_UNSTOW, IDD]",
			"[MOVE_1, 10, 480, IDD_MOVE, IDD]",
			"[MOVE_2, 1000, 480, IDD_MOVE, IDD]",
			"[APXS_1, 1, 180, APXS_START, APXS]",
			"[APXS_2, 181, 1800, APXS_ACQ, APXS]",
			"[APXS_3, 1981, 360, APXS_OFF, APXS]"
    };

    @SuppressWarnings("unchecked")
    @Test
	public void testFlightRuleViolation() {
//    	try{Thread.sleep(3000);}catch(Exception e){}
		trace.info("*** Flight Rule Violation test ***");
		EuropaSessionClient client = getTestClient();
		@SuppressWarnings("unused") Object result;
		try {
			registerActivities(client, registerInfo_flight_rule_violation);

//	    	  as.setActivityStartTime("UNSTOW_1",1);
			Vector<Object> setStarttime = new Vector<Object>();
			setStarttime.add("UNSTOW_1");
			setStarttime.add(1);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	  as.setActivityStartTime("MOVE_1",10);
			setStarttime = new Vector<Object>();
			setStarttime.add("MOVE_1");
			setStarttime.add(10);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	  // Following is inconsistent only with start times, which are only
//	    	  // used when checking passively for flight violations.
//	    	  as.addTemporalRelationConstraint("UNSTOW_1",start,"MOVE_1",start,
//	    	                                   1,1,"Test_Constraint");
			String[] temporalRelationInfo = { "[UNSTOW_1, start, MOVE_1, start, 1, 1]" };
			addTemporalRelationConstraint(client, temporalRelationInfo);

//	    	  as.setActivityStartTime("MOVE_2",1000);
			setStarttime = new Vector<Object>();
			setStarttime.add("MOVE_2");
			setStarttime.add(1000);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	  as.setActivityStartTime("APXS_1",1);
			setStarttime = new Vector<Object>();
			setStarttime.add("APXS_1");
			setStarttime.add(1);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	  as.setActivityStartTime("APXS_2",181);
			setStarttime = new Vector<Object>();
			setStarttime.add("APXS_2");
			setStarttime.add(181);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);
			
//	    	  as.setActivityStartTime("APXS_3",1981);
			setStarttime = new Vector<Object>();
			setStarttime.add("APXS_3");
			setStarttime.add(1981);
			sendData(client, EuropaCommand.SET_ACTIVITY_START_TIME, setStarttime);			
			
			// Check for consistency
			boolean isConsistent = client.isConsistent();
			if (isConsistent) {
				trace.info("Network consistent");
				
				// Check for violations
				Map<String,Object> violations = (Map<String,Object>)execute(client, EuropaCommand.GET_VIOLATIONS, true);
				if (violations != null) {
					Vector<String> temporals = (Vector<String>) violations.get("temporal");
					Vector<Map> flightRules = (Vector<Map>) violations.get("flight_rule");

					if (flightRules != null) {
						for (Map<String,Object> flightRule : flightRules) {
							int rawTime = (Integer) flightRule.get("time");
							String type = (String) flightRule.get("type");
							double level = (Double) flightRule.get("level");
							Vector culprits = (Vector) flightRule.get("culprits");
						    Date startTime = new Date(rawTime);
							IFlightRuleViolation flightRuleViolation = new FlightRuleViolation(startTime, type, level, culprits);
							trace.info("Flight rule violation: '" + flightRuleViolation.toString() + "'");
						}
					}
					if (temporals != null) {
					    for (String temporal : temporals) {
						    trace.info("Temporal violation: '" + temporal + "'");
					    }
					}
				}
			} else {
				trace.info("Network inconsistent");

				Object inconsistencies = execute(client, EuropaCommand.GET_NOGOOD, true);
				trace.info("GetNogood: '" + inconsistencies + "'");
			}
		} finally {
			client.disconnect();
		}
    }

    // TODO: enable tis test after we figure out what the intent was, see TODO note in the body below
    // @Test
    public void PaulsTest2() {
//    	try{Thread.sleep(3000);}catch(Exception e){}
		trace.info("*** Paul's test (multicall) ***");
		EuropaSessionClient client = getTestClient();
		Object result;
		boolean scheduled = true;
		boolean unknowns_ok = false;
		try {
			execute(client, EuropaCommand.TIMER_START, false);
			
	        Vector<Object> params = new Vector<Object>();
	        params.add("UNSTOW_1");
	        params.add(600);
			params.add(1);
			params.add("IDD_UNSTOW");
			params.add(scheduled);
			params.add(unknowns_ok);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, params, false);

	        params = new Vector<Object>();
	        params.add("MOVE_1");
	        params.add(480);
			params.add(10);
			params.add("IDD_MOVE");
			params.add(scheduled);
			params.add(unknowns_ok);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, params, false);

	        params = new Vector<Object>();
	        params.add("MOVE_2");
	        params.add(480);
			params.add(1000);
			params.add("IDD_MOVE");
			params.add(scheduled);
			params.add(unknowns_ok);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, params, false);

	        params = new Vector<Object>();
	        params.add("APXS_1");
	        params.add(180);
			params.add(1);
			params.add("APXS_START");
			params.add(scheduled);
			params.add(unknowns_ok);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, params, false);

	        params = new Vector<Object>();
	        params.add("APXS_2");
	        params.add(1800);
			params.add(181);
			params.add("APXS_ACQ");
			params.add(scheduled);
			params.add(unknowns_ok);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, params, false);

	        params = new Vector<Object>();
	        params.add("APXS_3");
	        params.add(360);
			params.add(1981);
			params.add("APXS_OFF");
			params.add(scheduled);
			params.add(unknowns_ok);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, params, false);

	        params = new Vector<Object>();
	        params.add("UNSTOW_1");
	        params.add("start");
			params.add("MOVE_1");
			params.add("start");
	        params.add(1);
			params.add(1);
			params.add("Test_Constraint");
			execute(client, EuropaCommand.ADD_TEMPORAL_RELATION_CONSTRAINT, params, false);
			
			// TODO: server returns an error on this call because the constraint network is inconsistent
			execute(client, EuropaCommand.GET_VIOLATIONS, false);

			execute(client, EuropaCommand.TIMER_STOP, false);
			
			result = endDeferredExecution(client);
            trace.info(result);
		} finally {
			client.disconnect();
		}
    }

	/**
	 */
    @Test
	public void testBasic() {
//    	try{Thread.sleep(3000);}catch(Exception e){}
		trace.info("*** Most basic testing ***");
		EuropaSessionClient client = getTestClient();
		Object result;
		try {
			result = registerActivities(client, BasicScenario.registerInfo_basic);
			result = addTemporalBoundConstraint(client, BasicScenario.temporalBoundInfo_basic);
//			addTemporalRelationConstraint(BasicScenario.temporalRelationInfo_basic);
			// Check for consistency
			boolean isConsistent = client.isConsistent();
			if (isConsistent) {
				trace.info("Network consistent");
				List<? extends Object> parameters = Collections.singletonList("MOVE_1");
				Map rawConstraints = (Map)execute(client, EuropaCommand.GET_ACTIVITY_CONSTRAINTS, parameters, true);
				trace.info(rawConstraints);
			} else {
				trace.info("Network inconsistent");
				result = execute(client, EuropaCommand.GET_NOGOOD, true);
				trace.info("nogood: '" + result + "'");
			}
		} finally {
			client.disconnect();
		}
	}

    //
    // Utility functions
    //    
    
	private String testSessionID = "session_test";

	// generate a unique session id for each test, in case they're run in parallel
	private synchronized String makeSessionId()
	{
		long timestamp = (new Date()).getTime();
		return testSessionID+timestamp;
	}
	
    private EuropaSessionClient getTestClient() {
    	EuropaSessionClient client = new EuropaSessionClient(makeSessionId(), false);
    	client.connect(host, port);
    	assertTrue(client.isConnected());
    	return client;
    }

    private Object execute(EuropaSessionClient client, EuropaCommand command, boolean sync) {
    	return execute(client, command, Collections.emptyList(), true);
    }

    private Object execute(EuropaSessionClient client, EuropaCommand command, List<? extends Object> parameters, boolean sync) {
    	Object result = client.syncExecute(command, parameters, true);
		assertFalse(String.valueOf(result), result instanceof Exception);
    	return result;
    }
    
    private List endDeferredExecution(EuropaSessionClient client) {
    	List results = null;
    	synchronized(client) {
    		results = client.flushQueue();
    		for (Object result : results) {
    			assertFalse(String.valueOf(result), result instanceof Exception);
    		}
    	}	
    	return results;
    }
    
    private Object registerActivities(EuropaSessionClient client, String[] tuples) {    	
    	// For each activity in the info array, collect its ID and duration.
    	for (String tuple : tuples) {
    		trace.debug("Tuple: '" + tuple + "'");
			int comma = tuple.indexOf(",");
			String activityID = tuple.substring(1,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			int startTime = new Integer(tuple.substring(0,comma));
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			int duration = new Integer(tuple.substring(0,comma));
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			String activityType = tuple.substring(0,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			boolean scheduled = true, unknowns_ok = true;
			List<? extends Object> parameters = Arrays.<Object>asList(activityID, duration, startTime, activityType, scheduled, unknowns_ok);
			trace.info("Sending to RegisterActivity  : " + parameters);
			execute(client, EuropaCommand.REGISTER_ACTIVITY, parameters, false);
    	}
    	// Execute all of the calls.
    	Object result = endDeferredExecution(client);
    	
        return result;
    }
    
    private Object addTemporalBoundConstraint(EuropaSessionClient client, String[] info) {
    	for (String tuple : info) {
			int comma = tuple.indexOf(",");
			String activityID = tuple.substring(1,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			String timePoint = tuple.substring(0,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			int minTime = new Integer(tuple.substring(0,comma));
			tuple = tuple.substring(comma+2);
			int maxTime = new Integer(tuple.substring(0,tuple.length()-1));
			
	        Vector<Object> params = new Vector<Object>();
	        params.add(activityID);
	        params.add(timePoint);
	        params.add(minTime);
	        params.add(maxTime);
	        
			String id = "[" + activityID + ", " + timePoint + ", " + minTime + ", " + maxTime + "]";
			params.add(id);	        
	        
			if (!temporalBoundConstraints.containsKey(id)) {			
			    trace.info("Sending to AddTemporalBoundConstraint  : " + params);			
			    execute(client, EuropaCommand.ADD_TEMPORAL_BOUND_CONSTRAINT, params, false);
			    temporalBoundConstraints.put(id, id);
		    } else {
		        trace.debug("Ignoring DUPLICATE temporalBoundConstraint  : " + id);			
		    }
		}    	
		Object result = endDeferredExecution(client);
		
        return result;
    }
    
    private Object addTemporalRelationConstraint(EuropaSessionClient client, String[] info) {
    	for (String tuple : info) {
//    		String id = tuple;
			int comma = tuple.indexOf(",");
			String activityA = tuple.substring(1,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			String timePointA = tuple.substring(0,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			String activityB = tuple.substring(0,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			String timePointB = tuple.substring(0,comma);
			tuple = tuple.substring(comma+2);
			comma = tuple.indexOf(",");
			int minTime = new Integer(tuple.substring(0,comma));
			tuple = tuple.substring(comma+2);
			int maxTime = new Integer(tuple.substring(0,tuple.length()-1));
						
	        Vector<Object> params = new Vector<Object>();
	        params.add(activityA); 
	        params.add(timePointA);
	        params.add(activityB);
	        params.add(timePointB);
	        params.add(minTime);
	        params.add(maxTime);
	        
			String id = "[" + activityA + ", " + timePointA + ", " +
			                    activityB + ", " + timePointB + ", " +
			                    minTime + ", " + maxTime + "]";				
	        params.add(id);
	        
			if (!temporalRelationConstraints.containsKey(id)) {			
			    trace.info("Sending to AddTemporalRelationConstraint  : " + params);			
			    execute(client, EuropaCommand.ADD_TEMPORAL_RELATION_CONSTRAINT, params, false);			
			    temporalRelationConstraints.put(id, id);
			} else {
			    trace.debug("Ignoring DUPLICATE temporalRelationConstraint  : " + id);			
			}
		}
    	Object result = endDeferredExecution(client);
    	
        return result;
    }
    
    private String[] registerInfo_test = {
			"[UNSTOW_1, 1, 600, IDD_UNSTOW, IDD]",
			"[MOVE_1, 10, 480, IDD_MOVE, IDD]",
			"[MOVE_2, 1000, 480, IDD_MOVE, IDD]",
			"[APXS_1, 1, 2340, APXS_ACQ, APXS]"
    };

    private void sendData(EuropaSessionClient client, EuropaCommand remoteMethod, List<? extends Object> params) {
		System.out.print("Sending to " + remoteMethod + ": " + params + " => '");
		Object result = execute(client, remoteMethod, params, true);				
		trace.info(result + "'");   	
    }
    
    @SuppressWarnings("unchecked")
	private boolean checkConsistency(EuropaSessionClient client) {
		// Check for consistency
		boolean isConsistent = client.isConsistent();
		if (isConsistent) {
			trace.info("Network consistent");
			return true;
		}
		trace.info("Network inconsistent");
		Object[] temp = (Object[])execute(client, EuropaCommand.GET_NOGOOD, true);
		Vector<Map> nogoods = new Vector<Map>(temp.length);
		for(int i = 0; i < temp.length; ++i)
			nogoods.add((Map)temp[i]);
		if (nogoods != null) {
			trace.info("no goods: '" + nogoods + "'");
			for (Map<String, Object> nogood : nogoods) {
				trace.info("");
				trace.info("  Point: " + nogood.get("point"));
				trace.info("  Length: " + nogood.get("length"));
				trace.info("  Activity: " + nogood.get("activity"));
				trace.info("  Key: " + nogood.get("key"));
			}
		}
		return false;
	}

}
